home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / Beteroid.swf / scripts / frame_4 / PlaceObject2_29_222 / CLIPACTIONRECORD onClipEvent(mouseMove).as < prev    next >
Encoding:
Text File  |  2006-06-13  |  331 b   |  18 lines

  1. onClipEvent(mouseMove){
  2.    mx = _root._xmouse;
  3.    my = _root._ymouse;
  4.    x = mx - _X;
  5.    y = my - _Y;
  6.    r = Math.sqrt(x * x + y * y);
  7.    sinTheta = y / r;
  8.    theta = Math.asin(sinTheta);
  9.    if(mx < _X)
  10.    {
  11.       _rotation = 180 - theta / 0.0175;
  12.    }
  13.    if(_X < mx)
  14.    {
  15.       _rotation = theta / 0.0175;
  16.    }
  17. }
  18.